home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / c / sozobon / sozlib15.zoo / sozdistr / include / xdlibs / fcntl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-06  |  1.4 KB  |  51 lines

  1. /*
  2.  *    FCNTL.H
  3.  */
  4.  
  5. #ifndef    _FCNTL_H
  6. #define    _FCNTL_H
  7.  
  8. /*
  9.  * defines for the access() function
  10.  */
  11. #define    F_OK            0
  12. #define    X_OK            1
  13. #define    W_OK            2
  14. #define    R_OK            4
  15.  
  16. /* 
  17.  * defines for iomode in open(), or TOS/MiNT Fopen()
  18.  * MagiC doesn't support all these flags this time
  19.  */
  20. #define _MIN_FILE_HANDLE -3
  21.  
  22. #define O_ACCMODE    0x03        /* used to mask off file access mode */
  23. #ifndef _file_h
  24. #define    O_RDONLY    0x00        /* read only */
  25. #define    O_WRONLY    0x01        /* write only */
  26. #define    O_RDWR        0x02        /* read/write */
  27.  
  28. #define    O_APPEND    0x08        /* position at EOF */
  29.  
  30. #define O_SHMODE    0x70    /* isolates file sharing mode */
  31. #    define O_COMPAT    0x00    /* compatibility mode */
  32. #    define O_DENYRW    0x10    /* deny both read and write access */
  33. #    define O_DENYW    0x20    /* deny write access to others */
  34. #    define O_DENYR    0x30    /* deny read access to others */
  35. #    define O_DENYNONE 0x40    /* don't deny any access to others */
  36.  
  37. #define O_NOINHERIT    0x80    /* private file (not passed to child) */
  38.  
  39. #define O_NDELAY    0x100    /* don't block for i/o on this file */
  40. #define O_CREAT        0x200    /* create file if it doesn't exist */
  41. #define O_TRUNC        0x400    /* truncate file to 0 bytes if it does exist */
  42. #define O_EXCL        0x800    /* fail open if file exists */
  43.  
  44. #define O_GLOBAL    0x1000    /* for opening a global file */
  45. #endif
  46.  
  47. extern int    creat(const char *filename, int pmode);
  48. extern int    open(const char *filename, int iomode, int pmode);
  49.  
  50. #endif /* _FCNTL_H */
  51.